package com.example.propertymanagement.repository;

import com.example.propertymanagement.entity.Building;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * BuildingRepository：楼栋数据访问接口
 */
@Repository
public interface BuildingRepository extends JpaRepository<Building, Integer> {

    /**
     * 根据小区ID查询楼栋列表
     * @param communityId 小区ID
     * @return 返回与指定小区关联的所有楼栋
     */
    List<Building> findByCommunityId(Integer communityId);  // 根据小区ID查询所有楼栋
}
